import{ae as d,bL as c,bI as v,G as i,B as l,bJ as u,bB as o,S as g,c as f,D as b,bK as m,e as h}from"./index-2104db4c.js";var y=`
    .p-avatar {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: dt('avatar.width');
        height: dt('avatar.height');
        font-size: dt('avatar.font.size');
        background: dt('avatar.background');
        color: dt('avatar.color');
        border-radius: dt('avatar.border.radius');
    }

    .p-avatar-image {
        background: transparent;
    }

    .p-avatar-circle {
        border-radius: 50%;
    }

    .p-avatar-circle img {
        border-radius: 50%;
    }

    .p-avatar-icon {
        font-size: dt('avatar.icon.size');
        width: dt('avatar.icon.size');
        height: dt('avatar.icon.size');
    }

    .p-avatar img {
        width: 100%;
        height: 100%;
    }

    .p-avatar-lg {
        width: dt('avatar.lg.width');
        height: dt('avatar.lg.width');
        font-size: dt('avatar.lg.font.size');
    }

    .p-avatar-lg .p-avatar-icon {
        font-size: dt('avatar.lg.icon.size');
        width: dt('avatar.lg.icon.size');
        height: dt('avatar.lg.icon.size');
    }

    .p-avatar-xl {
        width: dt('avatar.xl.width');
        height: dt('avatar.xl.width');
        font-size: dt('avatar.xl.font.size');
    }

    .p-avatar-xl .p-avatar-icon {
        font-size: dt('avatar.xl.icon.size');
        width: dt('avatar.xl.icon.size');
        height: dt('avatar.xl.icon.size');
    }

    .p-avatar-group {
        display: flex;
        align-items: center;
    }

    .p-avatar-group .p-avatar + .p-avatar {
        margin-inline-start: dt('avatar.group.offset');
    }

    .p-avatar-group .p-avatar {
        border: 2px solid dt('avatar.group.border.color');
    }

    .p-avatar-group .p-avatar-lg + .p-avatar-lg {
        margin-inline-start: dt('avatar.lg.group.offset');
    }

    .p-avatar-group .p-avatar-xl + .p-avatar-xl {
        margin-inline-start: dt('avatar.xl.group.offset');
    }
`,x={root:function(a){var t=a.props;return["p-avatar p-component",{"p-avatar-image":t.image!=null,"p-avatar-circle":t.shape==="circle","p-avatar-lg":t.size==="large","p-avatar-xl":t.size==="xlarge"}]},label:"p-avatar-label",icon:"p-avatar-icon"},z=d.extend({name:"avatar",style:y,classes:x}),S={name:"BaseAvatar",extends:v,props:{label:{type:String,default:null},icon:{type:String,default:null},image:{type:String,default:null},size:{type:String,default:"normal"},shape:{type:String,default:"square"},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null}},style:z,provide:function(){return{$pcAvatar:this,$parentInstance:this}}};function n(a){return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(a)}function p(a,t,e){return(t=w(t))in a?Object.defineProperty(a,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):a[t]=e,a}function w(a){var t=P(a,"string");return n(t)=="symbol"?t:t+""}function P(a,t){if(n(a)!="object"||!a)return a;var e=a[Symbol.toPrimitive];if(e!==void 0){var s=e.call(a,t);if(n(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(a)}var k={name:"Avatar",extends:S,inheritAttrs:!1,emits:["error"],methods:{onError:function(a){this.$emit("error",a)}},computed:{dataP:function(){return c(p(p({},this.shape,this.shape),this.size,this.size))}}},$=["aria-labelledby","aria-label","data-p"],L=["data-p"],E=["data-p"],j=["src","alt","data-p"];function A(a,t,e,s,B,r){return i(),l("div",o({class:a.cx("root"),"aria-labelledby":a.ariaLabelledby,"aria-label":a.ariaLabel},a.ptmi("root"),{"data-p":r.dataP}),[u(a.$slots,"default",{},function(){return[a.label?(i(),l("span",o({key:0,class:a.cx("label")},a.ptm("label"),{"data-p":r.dataP}),g(a.label),17,L)):a.$slots.icon?(i(),f(m(a.$slots.icon),{key:1,class:b(a.cx("icon"))},null,8,["class"])):a.icon?(i(),l("span",o({key:2,class:[a.cx("icon"),a.icon]},a.ptm("icon"),{"data-p":r.dataP}),null,16,E)):a.image?(i(),l("img",o({key:3,src:a.image,alt:a.ariaLabel,onError:t[0]||(t[0]=function(){return r.onError&&r.onError.apply(r,arguments)})},a.ptm("image"),{"data-p":r.dataP}),null,16,j)):h("",!0)]})],16,$)}k.render=A;export{k as x};
